﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.IO;

namespace TakeAPicture
{
    public class MSVideoSink : VideoSink
    {
        public MemoryStream VideoStream { get; private set; }
        public VideoFormat Format { get; set; }
        protected override void OnCaptureStarted() 
        { 
            VideoStream = new MemoryStream(); 
        }

        protected override void OnCaptureStopped() { }
        protected override void OnFormatChange(VideoFormat videoFormat)
        {
            Format = videoFormat;
        }

        protected override void OnSample(long sampleTime, long frameDuration, byte[] sampleData)
        {
            //VideoStream.Write(sampleData, 0, sampleData.Length);
        }
    }  

}
